#pragma import(__use_no_semihosting_swi)
struct __FILE { int handle; /* Add whatever you need here */ };
FILE __stdout;
FILE __stdin;
void _sys_exit(int x) 
{ 
    x = x;
} 
void _ttywrch(int ch)
{
    ch = ch;
}

void UART_Write_Blocking(usart_type* usart_x, uint8_t* data,uint16_t size)
{
	uint16_t i=0;
	for(i=0;i<size;i++)
	{
		usart_data_transmit(usart_x, (uint16_t)data[i]);
		while(usart_flag_get(usart_x, USART_TDC_FLAG) == RESET);
		usart_flag_clear(usart_x,USART_TDBE_FLAG);
	}
}

int fputc(int ch, FILE *f)  
{
	UART_Write_Blocking(DEBUG_UART_Handle,(uint8_t *)&ch,1);
//	HAL_UART_Transmit(&DEBUG_UART_Handle,(uint8_t *)&ch,1,0xFFFF);
//	HAL_UART_Transmit(&LCD_UART_Handle,(uint8_t *)&ch,1,0xFFFF);
	return ch;
}

